package com.zhiwang.planet.di.module

import androidx.appcompat.app.AppCompatActivity
import com.zhiwang.planet.mvvm.model.AppDataBase
import com.zhiwang.planet.mvvm.model.entity.UserDao
import dagger.Module
import dagger.Provides


/**
 * 用户信息模块，只负责用户信息获取，授权，登录，注册等和用户信息相关的功能
 */
@Module
class AccountModule(var activity: AppCompatActivity) {


    @Provides
    fun provideActivity(): AppCompatActivity {
        return activity
    }

    @Provides
    fun provideUserDao(appDatabase: AppDataBase): UserDao {
        return appDatabase.userDao()
    }


//    @Provides
//    fun provideBindDao(appDatabase: AppDataBase):BindDao{
//        return appDatabase.bindDao()
//    }

//    @Provides
//    fun providerUserViewModel(userDao: UserDao,restApi: RestApi): UserViewModel {
//        return UserViewModel(activity, userDao,restApi = restApi)
//    }
    //use Binds instead of Provides
//    @Provides
//    fun provideUserDataSource(userDataSource: UserDataSourceImpl): UserDataSource {
//        return userDataSource
//    }

//    @Provides
//    fun provideUserRepo(userDataSource: UserDataSource): IUserRepository {
//        return UserRepository(userDataSource)
//    }

}